// 应聘列表-应聘详情

var MyApplyDetail = Vue.component('MyApplyDetail', {
    data () {
        return {
            id: 1,
            tableData: {}
        }
    },
    methods: {
        onReturnFun: function () {
            window.history.back(-1)
        },
        onSaveEdit: function () {
            console.log("保存设置")
        }
    },
    // 周期
    created: function () {
        // 应聘列表
        var self = this
        $.ajax({
            type:"GET",
            url: _UrlPrefix + "/api/web/usercenter/zhaopin/accept-detail",
            data: {
                id: self.id,
                token: _AppToken
            },
            success:function(res){
                if(200 == res.code || 0 == res.code) {
                    console.log("res: ", res)
                    self.tableData = res.data
                }
            }
        })
    },
    template: ` <div class="my-apply">
                    <div class="apply-header">
                        <div class="apply-header-name">应聘列表</div>
                    </div>
                    <div class="apply-table apply-table-header apply-detail">
                        <table>
                            <tr>
                                <td style="width: 50%;">招聘公司</td>
                                <td style="width: 50%;">{{tableData.com_name}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">职位</td>
                                <td style="width: 50%;">{{tableData.job_name}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">还需人数</td>
                                <td style="width: 50%;">{{tableData.num}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">薪酬（元）</td>
                                <td style="width: 50%;">{{tableData.emolument}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">福利待遇</td>
                                <td style="width: 50%;">{{tableData.welfare}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">休息制度</td>
                                <td style="width: 50%;">{{tableData.rest}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">学历要求</td>
                                <td style="width: 50%;">{{tableData.education}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">工作年限</td>
                                <td style="width: 50%;">{{tableData.work_year}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">工作地点</td>
                                <td style="width: 50%;">{{tableData.address}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">岗位要求</td>
                                <td style="width: 50%;">{{tableData.detail}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">工作内容</td>
                                <td style="width: 50%;">{{tableData.content}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">工作时间</td>
                                <td style="width: 50%;">{{tableData.work_hour}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">联系人姓名</td>
                                <td style="width: 50%;">{{tableData.contact_name}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">联系人号码</td>
                                <td style="width: 50%;">{{tableData.contact_telephone}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">邮箱地址</td>
                                <td style="width: 50%;">{{tableData.email}}</td>
                            </tr>

                            <tr>
                                <td style="width: 50%;">年龄区间</td>
                                <td style="width: 50%;">{{tableData.age_range}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">技术工种</td>
                                <td style="width: 50%;">{{tableData.skill}}</td>
                            </tr>
                            <tr>
                                <td style="width: 50%;">面试状态</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 1">草稿</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 2">投递中</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 3">拒绝投递</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 4">面试邀请</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 5">拒绝邀请</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 6">面试失败</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 7">面试成功</td>
                                <td style="width: 50%;" v-if="tableData.job_status === 8">评价</td>
                            </tr>
                        </table>
                        <div class="btns">
                            <button class="btn btn-save" @click="onReturnFun">返回</button>
                            <button class="btn btn-primary" @click="onSaveEdit">保存设置</button>
                        </div>
                    </div>
                </div>`
})
